import request from "@/utils/request";
/**
 * 获取评论
 */
export function getCommentsPage(currentPage) {
    return request({
        url: process.env.VUE_APP_WEB_API +'/comments/'+currentPage,
        method:"get",
    })
}

/**
 * 文章详情部分获取评论
 * @param currentPage
 * @returns
 */
export function getComments(aid,currentPage) {
    return request({
        url: process.env.VUE_APP_WEB_API +'/comments/get/'+aid+"/"+currentPage,
        method:"get",
    })
}

/**
 * 根据cid删除一条评论
 * @param coid
 * @returns
 */
export function delComment(coid){
    return request({
        url: process.env.VUE_APP_WEB_API +'/comments/'+coid,
        method:"post",
    })
}
//增加评论
export function addComment(params){
    return request({
        url:process.env.VUE_APP_WEB_API +'/comments/add',
        method:"post",
        data:params

    })
}

//查询评论/留言
export function queryComment(params){
    return request({
        url:process.env.VUE_APP_WEB_API +'/comments/query',
        method:"post",
        data:params

    })
}